home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 April: Mac OS SDK / Dev.CD Apr 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / AIncludes / ControlStrip.a < prev    next >
Encoding:
Text File  |  1996-01-24  |  9.2 KB  |  388 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        ControlStrip.a
  3. ;
  4. ;    Contains:    Control Strip (for Powerbooks and Duos) Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Package:    Universal Interfaces 2.2 in “MPW” on ETO #20
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__CONTROLSTRIP__') = 'UNDEFINED' THEN
  21. __CONTROLSTRIP__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  25.     include 'Types.a'
  26.     ENDIF
  27. ;        include 'ConditionalMacros.a'                                ;
  28.  
  29.     IF &TYPE('__MENUS__') = 'UNDEFINED' THEN
  30.     include 'Menus.a'
  31.     ENDIF
  32. ;        include 'Memory.a'                                            ;
  33. ;            include 'MixedMode.a'                                    ;
  34. ;        include 'Quickdraw.a'                                        ;
  35. ;            include 'QuickdrawText.a'                                ;
  36.  
  37.     IF &TYPE('__DIALOGS__') = 'UNDEFINED' THEN
  38.     include 'Dialogs.a'
  39.     ENDIF
  40. ;        include 'Errors.a'                                            ;
  41. ;        include 'Controls.a'                                        ;
  42. ;        include 'Windows.a'                                        ;
  43. ;            include 'Events.a'                                        ;
  44. ;                include 'OSUtils.a'                                ;
  45. ;        include 'TextEdit.a'                                        ;
  46.  
  47. sdevInitModule                    EQU        0                    ; initialize the module
  48. sdevCloseModule                    EQU        1                    ; clean up before being closed
  49. sdevFeatures                    EQU        2                    ; return feature bits
  50. sdevGetDisplayWidth                EQU        3                    ; returns the width of the module's display
  51. sdevPeriodicTickle                EQU        4                    ; periodic tickle when nothing else is happening
  52. sdevDrawStatus                    EQU        5                    ; update the interface in the Control Strip
  53. sdevMouseClick                    EQU        6                    ; user clicked on the module's display area in the Control Strip
  54. sdevSaveSettings                EQU        7                    ; saved any changed settings in module's preferences file
  55. sdevShowBalloonHelp                EQU        8                    ; puts up a help balloon, if the module has one to display
  56.  
  57. ;********************************************************************************************
  58. ;
  59. ;    Features supported by the module.  If a bit is set, it means that feature is supported.
  60. ;    All undefined bits are reserved for future use by Apple, and should be set to zero.
  61. ;
  62. ;********************************************************************************************
  63. sdevWantMouseClicks                EQU        0                    ; notify the module of mouseDown events
  64. sdevDontAutoTrack                EQU        1                    ; call the module to do mouse tracking
  65. sdevHasCustomHelp                EQU        2                    ; module provides its own help messages
  66. sdevKeepModuleLocked            EQU        3                    ; module needs to be locked in the heap
  67.  
  68. ;********************************************************************************************
  69. ;
  70. ;    Result values returned by the sdevPeriodicTickle and sdevIconMouseClick selectors.
  71. ;    If a bit is set, the module can request that a specific function is performed by
  72. ;    the Control Strip.  A result of zero will do nothing.  All undefined bits are reserved
  73. ;    for future use by Apple, and should be set to zero.
  74. ;
  75. ;********************************************************************************************
  76. sdevResizeDisplay                EQU        0                    ; resize the module's display
  77. sdevNeedToSave                    EQU        1                    ; need to save changed settings, when convenient
  78. sdevHelpStateChange                EQU        2                    ; need to update the help message because of a state change
  79. sdevCloseNow                    EQU        3                    ; close a module because it doesn't want to stay around
  80.  
  81. ;********************************************************************************************
  82. ;
  83. ;    miscellaneous
  84. ;
  85. ;********************************************************************************************
  86. sdevFileType                    EQU        'sdev'
  87.  
  88. sdevMenuItemMark                EQU        '•'
  89.  
  90. ;    direction values for SBDrawBarGraph
  91. BarGraphSlopeLeft                EQU        -1                    ; max end of sloping bar graph is on the left
  92. BarGraphFlatRight                EQU        0                    ; max end of flat bar graph is on the right
  93. BarGraphSlopeRight                EQU        1                    ; max end of sloping bar graph is on the right
  94.  
  95. ;********************************************************************************************
  96. ;
  97. ;    utility routines to provide standard interface elements and support for common functions
  98. ;
  99. ;********************************************************************************************
  100. ;
  101. ; pascal Boolean SBIsControlStripVisible(void)
  102. ;
  103.     IF ¬ GENERATINGCFM THEN
  104.         Macro
  105.         _SBIsControlStripVisible
  106.             moveq    #0,d0
  107.             dc.w     $AAF2
  108.         EndM
  109.     ELSE
  110.         IMPORT_CFM_FUNCTION    SBIsControlStripVisible
  111.     ENDIF
  112.  
  113. ;
  114. ; pascal void SBShowHideControlStrip(Boolean showIt)
  115. ;
  116.     IF ¬ GENERATINGCFM THEN
  117.         Macro
  118.         _SBShowHideControlStrip
  119.             move.w    #$0101,d0
  120.             dc.w     $AAF2
  121.         EndM
  122.     ELSE
  123.         IMPORT_CFM_FUNCTION    SBShowHideControlStrip
  124.     ENDIF
  125.  
  126. ;
  127. ; pascal Boolean SBSafeToAccessStartupDisk(void)
  128. ;
  129.     IF ¬ GENERATINGCFM THEN
  130.         Macro
  131.         _SBSafeToAccessStartupDisk
  132.             moveq    #2,d0
  133.             dc.w     $AAF2
  134.         EndM
  135.     ELSE
  136.         IMPORT_CFM_FUNCTION    SBSafeToAccessStartupDisk
  137.     ENDIF
  138.  
  139. ;
  140. ; pascal short SBOpenModuleResourceFile(OSType fileCreator)
  141. ;
  142.     IF ¬ GENERATINGCFM THEN
  143.         Macro
  144.         _SBOpenModuleResourceFile
  145.             move.w    #$0203,d0
  146.             dc.w     $AAF2
  147.         EndM
  148.     ELSE
  149.         IMPORT_CFM_FUNCTION    SBOpenModuleResourceFile
  150.     ENDIF
  151.  
  152. ;
  153. ; pascal OSErr SBLoadPreferences(ConstStr255Param prefsResourceName, Handle *preferences)
  154. ;
  155.     IF ¬ GENERATINGCFM THEN
  156.         Macro
  157.         _SBLoadPreferences
  158.             move.w    #$0404,d0
  159.             dc.w     $AAF2
  160.         EndM
  161.     ELSE
  162.         IMPORT_CFM_FUNCTION    SBLoadPreferences
  163.     ENDIF
  164.  
  165. ;
  166. ; pascal OSErr SBSavePreferences(ConstStr255Param prefsResourceName, Handle preferences)
  167. ;
  168.     IF ¬ GENERATINGCFM THEN
  169.         Macro
  170.         _SBSavePreferences
  171.             move.w    #$0405,d0
  172.             dc.w     $AAF2
  173.         EndM
  174.     ELSE
  175.         IMPORT_CFM_FUNCTION    SBSavePreferences
  176.     ENDIF
  177.  
  178. ;
  179. ; pascal void SBGetDetachedIndString(StringPtr theString, Handle stringList, short whichString)
  180. ;
  181.     IF ¬ GENERATINGCFM THEN
  182.         Macro
  183.         _SBGetDetachedIndString
  184.             move.w    #$0506,d0
  185.             dc.w     $AAF2
  186.         EndM
  187.     ELSE
  188.         IMPORT_CFM_FUNCTION    SBGetDetachedIndString
  189.     ENDIF
  190.  
  191. ;
  192. ; pascal OSErr SBGetDetachIconSuite(Handle *theIconSuite, short theResID, unsigned long selector)
  193. ;
  194.     IF ¬ GENERATINGCFM THEN
  195.         Macro
  196.         _SBGetDetachIconSuite
  197.             move.w    #$0507,d0
  198.             dc.w     $AAF2
  199.         EndM
  200.     ELSE
  201.         IMPORT_CFM_FUNCTION    SBGetDetachIconSuite
  202.     ENDIF
  203.  
  204. ;
  205. ; pascal OSErr SBTrackPopupMenu(const Rect *moduleRect, MenuHandle theMenu)
  206. ;
  207.     IF ¬ GENERATINGCFM THEN
  208.         Macro
  209.         _SBTrackPopupMenu
  210.             move.w    #$0408,d0
  211.             dc.w     $AAF2
  212.         EndM
  213.     ELSE
  214.         IMPORT_CFM_FUNCTION    SBTrackPopupMenu
  215.     ENDIF
  216.  
  217. ;
  218. ; pascal OSErr SBTrackSlider(const Rect *moduleRect, short ticksOnSlider, short initialValue)
  219. ;
  220.     IF ¬ GENERATINGCFM THEN
  221.         Macro
  222.         _SBTrackSlider
  223.             move.w    #$0409,d0
  224.             dc.w     $AAF2
  225.         EndM
  226.     ELSE
  227.         IMPORT_CFM_FUNCTION    SBTrackSlider
  228.     ENDIF
  229.  
  230. ;
  231. ; pascal OSErr SBShowHelpString(const Rect *moduleRect, StringPtr helpString)
  232. ;
  233.     IF ¬ GENERATINGCFM THEN
  234.         Macro
  235.         _SBShowHelpString
  236.             move.w    #$040A,d0
  237.             dc.w     $AAF2
  238.         EndM
  239.     ELSE
  240.         IMPORT_CFM_FUNCTION    SBShowHelpString
  241.     ENDIF
  242.  
  243. ;
  244. ; pascal short SBGetBarGraphWidth(short barCount)
  245. ;
  246.     IF ¬ GENERATINGCFM THEN
  247.         Macro
  248.         _SBGetBarGraphWidth
  249.             move.w    #$010B,d0
  250.             dc.w     $AAF2
  251.         EndM
  252.     ELSE
  253.         IMPORT_CFM_FUNCTION    SBGetBarGraphWidth
  254.     ENDIF
  255.  
  256. ;
  257. ; pascal void SBDrawBarGraph(short level, short barCount, short direction, Point barGraphTopLeft)
  258. ;
  259.     IF ¬ GENERATINGCFM THEN
  260.         Macro
  261.         _SBDrawBarGraph
  262.             move.w    #$050C,d0
  263.             dc.w     $AAF2
  264.         EndM
  265.     ELSE
  266.         IMPORT_CFM_FUNCTION    SBDrawBarGraph
  267.     ENDIF
  268.  
  269. ;
  270. ; pascal void SBModalDialogInContext(ModalFilterUPP filterProc, short *itemHit)
  271. ;
  272.     IF ¬ GENERATINGCFM THEN
  273.         Macro
  274.         _SBModalDialogInContext
  275.             move.w    #$040D,d0
  276.             dc.w     $AAF2
  277.         EndM
  278.     ELSE
  279.         IMPORT_CFM_FUNCTION    SBModalDialogInContext
  280.     ENDIF
  281.  
  282. ; The following routines are available in Control Strip 1.2 and later. 
  283. ;
  284. ; pascal OSErr SBGetControlStripFontID(short *fontID)
  285. ;
  286.     IF ¬ GENERATINGCFM THEN
  287.         Macro
  288.         _SBGetControlStripFontID
  289.             move.w    #$020E,d0
  290.             dc.w     $AAF2
  291.         EndM
  292.     ELSE
  293.         IMPORT_CFM_FUNCTION    SBGetControlStripFontID
  294.     ENDIF
  295.  
  296. ;
  297. ; pascal OSErr SBSetControlStripFontID(short fontID)
  298. ;
  299.     IF ¬ GENERATINGCFM THEN
  300.         Macro
  301.         _SBSetControlStripFontID
  302.             move.w    #$010F,d0
  303.             dc.w     $AAF2
  304.         EndM
  305.     ELSE
  306.         IMPORT_CFM_FUNCTION    SBSetControlStripFontID
  307.     ENDIF
  308.  
  309. ;
  310. ; pascal OSErr SBGetControlStripFontSize(short *fontSize)
  311. ;
  312.     IF ¬ GENERATINGCFM THEN
  313.         Macro
  314.         _SBGetControlStripFontSize
  315.             move.w    #$0210,d0
  316.             dc.w     $AAF2
  317.         EndM
  318.     ELSE
  319.         IMPORT_CFM_FUNCTION    SBGetControlStripFontSize
  320.     ENDIF
  321.  
  322. ;
  323. ; pascal OSErr SBSetControlStripFontSize(short fontSize)
  324. ;
  325.     IF ¬ GENERATINGCFM THEN
  326.         Macro
  327.         _SBSetControlStripFontSize
  328.             move.w    #$0111,d0
  329.             dc.w     $AAF2
  330.         EndM
  331.     ELSE
  332.         IMPORT_CFM_FUNCTION    SBSetControlStripFontSize
  333.     ENDIF
  334.  
  335. ;
  336. ; pascal OSErr SBGetShowHideHotKey(short *modifiers, unsigned char *keyCode)
  337. ;
  338.     IF ¬ GENERATINGCFM THEN
  339.         Macro
  340.         _SBGetShowHideHotKey
  341.             move.w    #$0412,d0
  342.             dc.w     $AAF2
  343.         EndM
  344.     ELSE
  345.         IMPORT_CFM_FUNCTION    SBGetShowHideHotKey
  346.     ENDIF
  347.  
  348. ;
  349. ; pascal OSErr SBSetShowHideHotKey(short modifiers, unsigned char keyCode)
  350. ;
  351.     IF ¬ GENERATINGCFM THEN
  352.         Macro
  353.         _SBSetShowHideHotKey
  354.             move.w    #$0213,d0
  355.             dc.w     $AAF2
  356.         EndM
  357.     ELSE
  358.         IMPORT_CFM_FUNCTION    SBSetShowHideHotKey
  359.     ENDIF
  360.  
  361. ;
  362. ; pascal OSErr SBIsShowHideHotKeyEnabled(Boolean *enabled)
  363. ;
  364.     IF ¬ GENERATINGCFM THEN
  365.         Macro
  366.         _SBIsShowHideHotKeyEnabled
  367.             move.w    #$0214,d0
  368.             dc.w     $AAF2
  369.         EndM
  370.     ELSE
  371.         IMPORT_CFM_FUNCTION    SBIsShowHideHotKeyEnabled
  372.     ENDIF
  373.  
  374. ;
  375. ; pascal OSErr SBEnableShowHideHotKey(Boolean enabled)
  376. ;
  377.     IF ¬ GENERATINGCFM THEN
  378.         Macro
  379.         _SBEnableShowHideHotKey
  380.             move.w    #$0115,d0
  381.             dc.w     $AAF2
  382.         EndM
  383.     ELSE
  384.         IMPORT_CFM_FUNCTION    SBEnableShowHideHotKey
  385.     ENDIF
  386.  
  387.     ENDIF ; __CONTROLSTRIP__
  388.